# 运算符  加   和  乘
# 当为字符串类型乘时，为复制功能

'''
a = "1"
b = "2"
print(a + b)  # 不可执行
print(b * 10)
print(a * 3)

a, b, c = 1, 2, [1,2]
print(a, b, c)

q = w = 123
print(q, w)

c = 10
c -= 8+9
print(c)

d=9
d //= 1
print(d)

r = 100
r /= 5+5
print(r)
'''

a = 10
b = 11
print(a == b)
print(a <= b)
print(a >= b)
print(a != b)
print(a > b)

a = 1
b = 2
c = 3
print((a < b) and (b < c))
print((a < b) or (c < b))
print(not (c < b))
print(not (b > b))
print(not (b > c))
print(not (b > a))

str1 = "i'm jerry"
print(str1)

str2 = '''
1
11
111
'''
print(str2)

str3 = 'i\'m jerry'
print(str3)

str4 = '''
"2"'''
print(type(str4))

name = "123456789"
print(name[1:3])
print(name[::-1])
print(name[-3:])
print(name[:])
print(name[::3])
print(name[:5])
print(name[:-2])
print(name[1:5])

print(name[5:2:-2])

name = "hello world and supertest and chenghao and Python"
print(name.find("and"))
print(name.find("and",15,30))
print(name.index("and"))
# print(name.index("ands"))
print(name.find("ands"))
print(name.rfind("and"))
# print(name.rindex("ands"))
print(name.count("and"))
print(name.count("nd"))
print(name.count("and",10,20))
print(name.count(""))

# 替换
name = "hello world and supertest and chenghao and Python"
print(name.replace("and", "he"))
print(name.replace("and", "he", 1))
print(name)
# 分割
print(name.split("and"))
print(name.split(" "))
print(name.split("and", 1))
# 拼接
list1 = ['chao', 'ge', 'test', 'promotion']
t1 = ('aa', 'b', 'cc', 'ddd')
print('--'.join(list1))
print("==".join(t1))
print(name.lower())

str2 = "    hello    "
print((str2.strip()))
str3 ="hello"
print(str3.center(10,"_"))

mystr1 = 'hello'
mystr2 = 'hello12345'
print(mystr1.isalpha())
print(mystr2.isdigit())
print(mystr2.isalnum())